<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-lx-cascades"></i> 案件登记
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <div>
                <el-form :model="formInline" label-width="100px">

                    <el-row type="flex">
                        <el-col :span="4" >
                            <el-form-item label="承保机构">
                                <el-input  placeholder="请输入承保机构" style="width: 100%"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="4" :offset="1">
                            <el-form-item label="投保人">
                                <el-input  placeholder="请输入投保人" style="width: 100%"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="4" :offset="1">
                            <el-form-item label="被保险人">
                                <el-input  placeholder="请输入被保险人" style="width: 100%"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="4" :offset="1">
                            <el-form-item label="证件号">
                                <el-input  placeholder="请输入证件号" style="width: 100%"></el-input>
                            </el-form-item>
                        </el-col>

                    </el-row>
                    <el-row type="flex" justify="center" style="margin-top: 30px;" >
                        <el-col :span="4" style="text-align: center">
                            <el-form-item size="big">
                                <el-button type="primary" @click="onSubmit" style="width: 100%;">查询</el-button>
                            </el-form-item>
                        </el-col>
                        <el-col :span="4" style="text-align: center">
                            <el-form-item size="big">
                                <el-button type="primary" @click="onSubmit" style="width: 100%;">重置</el-button>
                            </el-form-item>
                        </el-col>
                        <!-- <el-col :span="4" style="text-align: center">
                            <el-form-item size="big">
                                <el-button type="primary" @click="toDetail" style="width: 100%;">添加案件</el-button>
                            </el-form-item>
                        </el-col>  -->
                    </el-row>
                </el-form>
            </div>
            <template>
                <div>
                    <el-divider></el-divider>
                </div>
            </template>
            <el-table
                    :data="tableData"
                    border
                    class="table"
                    ref="multipleTable"
                    header-cell-class-name="table-header"
                    style="margin-top: 30px"
            >
                <el-table-column type="selection" label="序号" width="55" align="center" show-overflow-tooltip></el-table-column>
                <el-table-column prop="taskNo" label="任务号" width="200px" align="center"></el-table-column>
                <el-table-column prop="policyNo" label="保单号" width="200px" align="center"></el-table-column>
                <el-table-column prop="name2" label="险种" width="180px" align="center"></el-table-column>
                <el-table-column prop="zhuangt" label="承保机构" width="200px" align="center"></el-table-column>
                <el-table-column prop="data4" label="投保人" width="150px"  align="center"></el-table-column>
                <el-table-column prop="data1" label="被保险人" width="150px"  align="center"></el-table-column>
                <el-table-column prop="data2" label="证件号" width="200px"></el-table-column>
                <el-table-column prop="zhifuriqi" label="起保日期" width="180px" align="center"></el-table-column>
                <el-table-column prop="data3" label="终保日期" width="180px" align="center"></el-table-column>
                <el-table-column label="操作" width="auto" align="center">
                    <template>
                        <router-link to='../caseProcessDetail'>
                        <el-button type="text"  >案件登记</el-button>
                        </router-link>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination">
                <el-pagination
                        background
                        layout="prev, pager, next"
                        :total="1">
                </el-pagination>
            </div>

        </div>
    </div>
</template>

<script>
    export default {
        name: 'rengonghepei',
        data() {
            return {
                redore: true,
                guanzhus: null,
                centerDialogVisible:false,
                query: {
                    address: '',
                    name: '',
                    pageIndex: 1,
                    pageSize: 10
                },
                tableData: [
                    {
                        taskNo:"202107222147001",
                        policyNo:'203012019500002',
                        data1:'李刚',
                        data2:'45641122788989',
                        flag:'是',
                        data3:'2021-4-2',
                        fangshi:'45641122788979',
                        name2:'节假日旅游保险',
                        data4: "江苏省徐州市医保局",
                        zhuangt:"城堡医疗",
                        zhifufangshi:"转账",
                        zhifuduixiang:"张全",
                        zhifujiafang:"全运公司",
                        zhifuriqi:"2020-09-12"
                    }
                ],
                multipleSelection: [],
                delList: [],
                editVisible: false,
                pageTotal: 3,
                form: {},
                idx: -1,
                id: -1,
                formInline: {
                    user: '',
                    region: ''
                }
            };
        },
        created() {
            this.getData();
        },
        methods: {
             // 跳转明细页面
            toDetail(){
                this.$router.push('/caseProcessDetail')
            },
            // 获取 easy-mock 的模拟数据
            // 触发搜索按钮
            handleSearch() {
                this.$set(this.query, 'pageIndex', 1);
                this.getData();
            },
            // 删除操作
            handleDelete(index, row) {
                // 二次确认删除
                /* this.$confirm('确定要删除吗？', '提示', {
                     type: 'warning'
                 })
                     .then(() => {
                         this.$message.success('删除成功');
                         this.tableData.splice(index, 1);
                     })
                     .catch(() => {});*/





            },
            // 多选操作
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            delAllSelection() {
                const length = this.multipleSelection.length;
                let str = '';
                this.delList = this.delList.concat(this.multipleSelection);
                for (let i = 0; i < length; i++) {
                    str += this.multipleSelection[i].name + ' ';
                }
                this.$message.error(`删除了${str}`);
                this.multipleSelection = [];
            },
            // 编辑操作
            handleEdit(index, row) {
                this.idx = index;
                this.form = row;
                this.editVisible = true;
            },
            // 保存编辑
            saveEdit() {
                this.editVisible = false;
                this.$message.success(`修改第 ${this.idx + 1} 行成功`);
                this.$set(this.tableData, this.idx, this.form);
            },
            // 分页导航
            handlePageChange(val) {
                this.$set(this.query, 'pageIndex', val);
                this.getData();
            },
            onSubmit() {
                console.log('submit!');
            }
        }
    };
</script>

<style scoped>
    .handle-box {
        margin-bottom: 20px;
    }

    .handle-select {
        width: 120px;
    }

    .handle-input {
        width: 300px;
        display: inline-block;
    }
    .table {
        width: 100%;
        font-size: 14px;
    }
    .red {
        color: #ff0000;
    }
    .mr10 {
        margin-right: 10px;
    }
    .table-td-thumb {
        display: block;
        margin: auto;
        width: 40px;
        height: 40px;
    }
</style>
